﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace NoteHelper.Model
{
    public class DbUserBase
    {
        public DbUserBase()
        {
            CreateUser = "";
            CreateAt = DateTime.Now;
            UpdateUser = "";
            UpdateAt = CreateAt;
        }

        [DisplayName("创建人")]
        [StringLength(20)]
        [Required(AllowEmptyStrings = true)]
        public string CreateUser { get; set; }

        [DisplayName("创建时间")]
        public DateTime CreateAt { get; set; }

        [DisplayName("最后修改人")]
        [StringLength(20)]
        [Required(AllowEmptyStrings = true)]
        public string UpdateUser { get; set; }

        [DisplayName("最后修改时间")]
        public DateTime UpdateAt { get; set; }
    }

    /// <summary>
    /// 项目中所有的Form
    /// </summary>
    public class ProjectForm : DbUserBase
    {
        [DisplayName("窗体编号")]
        [StringLength(10, ErrorMessage = "窗体编号最多允许10位")]
        [Required]
        public string ObjectID { get; set; }

        public string ObjectIDBak { get; set; }

        [DisplayName("描述")]
        [StringLength(512)]
        [Required(AllowEmptyStrings = true)]
        public string Description { get; set; }

        [DisplayName("完整名称")]
        [StringLength(256)]
        [Required]
        public string FullName { get; set; }
    }
}
